package com.song.EMS.wx.controller;

import com.song.EMS.bean.Message;
import com.song.EMS.mvc.ResponseBody;
import com.song.EMS.mvc.ResponseView;
import com.song.EMS.utils.JsonUtil;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class UserQRcodeController {
    /**
     * 将当前快递的取件码设置在二维码中
     * @param request
     * @param response
     * @return
     */
    @ResponseView("/wx/createQRcord.do")
    public String setQRcode(HttpServletRequest request, HttpServletResponse response){
        String qrCode = null;
        String code = request.getParameter("code");
        String type = request.getParameter("type");
        System.out.println(type);
        if ("express".equals(type)){
            qrCode = code;
        }else {
            qrCode = UserUtils.getUserPhone(request);
        }
        System.out.println(qrCode);
        request.getSession().setAttribute("qrCode",qrCode);
        return "/personQRcode.jsp";
    }
}
